var app = angular.module('addLmApp',[]);
app.controller('addLmController',function($scope,$http){

    /*更新课程操作*/
    $scope.addLaboratory = function () {

        $scope.lmdata = {lname:$scope.lname,
            lintroduce:$scope.lintroduce,
            lresponsible:$scope.lresponsible,
            lcapacity:$scope.lcapacity,
            lstatus:$scope.lstatus};
        $http({
            method: 'POST',
            url: 'laboratory/addLaboratory.do',
            params: $scope.lmdata,
            headers: { 'Content-Type': 'application/x-www-form-urlencoded'}
        }).then(function successCallback(response) {
            console.log(response);
            $scope.isSuccess = response.data.isSuccess;
            if($scope.isSuccess){
                alert("添加成功");
                window.location.href = "/laboratorymsg.do";
            }else
                alert("添加失败");
        }, function errorCallback(response) {
            console.log("获取失败！");
        });
    };

    $scope.backTolmList = function () {
        window.location.href = "/laboratorymsg.do";
    };


});